home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1346 < prev    next >
Encoding:
Text File  |  1996-08-06  |  970 b   |  44 lines

  1. Newsgroups: comp.lang.c++
  2. Path: artemis.sto.fdata.se!news
  3. From: Niklas Mellin <niklas.mellin@sto.fdata.se>
  4. Subject: Is this code valid?
  5. Sender: news@artemis.sto.fdata.se (UseNet NetNews)
  6. Message-ID: <30F3E42D.74BA@sto.fdata.se>
  7. Date: Wed, 10 Jan 1996 16:07:09 GMT
  8. Content-Transfer-Encoding: 7bit
  9. Content-Type: text/plain; charset=us-ascii
  10. Mime-Version: 1.0
  11. X-Mailer: Mozilla 2.0b4 (WinNT; I)
  12. Organization: WM-data F÷rsvarsdata AB, Sweden
  13.  
  14. class X
  15. {
  16.   public:
  17.   class Y;
  18. };
  19.  
  20. class X::Y
  21. {
  22. };
  23.  
  24. int main(int, char* [])
  25. {
  26.   throw X::Y();
  27.   return 0;
  28. }
  29.  
  30. It doesn't matter if the throw statement is in main or in some
  31. other function, and it makes no difference if there is a catch
  32. statement.
  33.  
  34. When linking the code above in Borland C++ 4.0 the ide crashes
  35. killing windows too (it took me a while to isolate the problem).
  36.  
  37. Borland 4.5 doesn't crash but reports: "Internal error..." some
  38. number.
  39.  
  40. My question: Is it allowed to throw objects of nested classes?
  41.  
  42. ---
  43. Niklas Mellin
  44.